extern "C" {
#include <string.h>
#include <time.h>
}
#include <map>
#include <string>
#include <vector>
#ifndef __UTILS_HPP__
#define __UTILS_HPP__
namespace util {

  void split(
        const std::string& src,
        const std::string& d,
        std::vector<std::string>& result);

  std::string trim(const std::string& str);

  const char* get_ext(const char* path);

  std::string to_string(const off_t size);

  namespace time {
    std::string get_date_str_rfc1123();
    std::string get_date_str_rfc1123(const time_t& tt);
    time_t parse_rfc1123(const char* str, const int isdst);
  }

  namespace debug {
    void debug_map(
          const char* bmsg,
          const std::map<std::string, std::string>& map,
          const char* emsg);
  }
}
#endif
